<template>
    <div class="con">
        <div class="card" v-for="(item,index) in data" :key="index" @click="noticeDetail(item.noticeId)">
            <div class="text">
                <p class="time">{{item.createTime}}</p>
                <p class="titlenotice">{{item.title}}</p>
                <!-- <p class="detail" v-html="item.message">{{item.message}}</p> -->
                <div style="height:20px"></div>
            </div>

        </div>
        <div style="height:50px"></div>
    </div>
</template>

<script>
export default {
    name: "allnotice",
    data() {
        return {
            data: {}
        };
    },
    methods: {
        noticeDetail(noticeId) {
            this.$router.push({
                name: "notice",
                query: { noticeId: noticeId }
            });
        }
    },
    mounted() {
        this.axios
            .get(`${this.siteUrl}/notice/public/list.do`)
            .then(response => {
             
                if (response.data.success == 1) {
                    this.data = response.data.data;
                }
            })
            .catch(function(error) {
                console.log(error);
            });


    }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.con {
    width: 100%;
    min-height: 100vh;
    background: #0b94de;
    overflow: hidden;
}
.card:first-child {
    margin-top: 15px;
}
.card {
    width: 92%;
    margin-left: 4%;
    margin-top: 10px;
    background: linear-gradient(to bottom right, #fff6ea, #fff);
    border-radius: 4px;
    overflow: hidden;
}
.card .text {
    width: 90%;
    margin-left: 5%;
}
.card img {
    width: 100%;
}
.card .time {
    color: #999;
    font-size: 12px;
    font-weight: 200;
    margin-top: 15px;
}
.card .titlenotice {
    font-size: 16px;
    margin-top: 10px;
    line-height: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.card .detail {
    font-size: 12px;
    margin-top: 10px;
    margin-bottom: 15px;
    color: #333333;
    font-weight: 200;
    line-height: 21px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

</style>
